/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.com.ugto.caadi.asistencias.util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Maestria
 */
public class ConexionSQL {

    private static final String URL = "jdbc:mysql://localhost/caadi";
    private static final String USER = "root";
    private static final String PASS = "123456";

    public static Connection getConexion() {
        Connection connection = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection(URL, USER, PASS);
        } catch (Exception e) {
            e.printStackTrace();
            connection = null;
        }
        return connection;
    }

    public static void main(String[] args) {
        if (getConexion() != null) {
            System.out.println("Succes!");
        } else {
            System.out.println("Error!");
        }
    }
}
